package com.zb.controller;

import com.zb.exceptions.BusinessException;
import com.zb.service.LoginUserService;
import com.zb.util.ResultResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private LoginUserService loginUserService;
    @PostMapping("/login")
    public ResultResponse login(@RequestParam("nickname") String nickname,
                                @RequestParam("passwd") String passwd)throws BusinessException {

        return loginUserService.login(nickname,passwd);
    }
}
